﻿<table cellpadding="0" cellspacing="1" border="0" width="100%" class="formtable">
    <tr>
        <th style="width:80px;">绑定字段：</th>
        <td><select class="myselect2" id="bindfiled" style="width:290px"></select></td>
    </tr>
    <tr>
        <th>默认值：</th>
        <td>
            <div style="margin-bottom: 6px;"><select class="myselect" id="defaultvalueselect" onchange="parent.insertElementText(document.getElementById('defaultvalue'), this.value);" style="width:290px"></select></div>
            <div><textarea class="mytextarea" id="defaultvalue" style="width:98%; height:50px; margin-right:6px;"></textarea></div>
        </td>
    </tr>
    <tr>
        <th>窗口标题：</th>
        <td>
            <input type="text" class="mytext" style="width:90%;" id="windowtitle" />
        </td>
    </tr>
    <tr>
        <th>控件宽度：</th>
        <td>
            <input type="text" id="width" class="mytext" style="width:150px" />
            弹出宽度：<input type="text" id="windowwidth" class="mytext" style="width:80px" />PX
            弹出高度：<input type="text" id="windowheight" class="mytext" style="width:80px" />PX
        </td>
    </tr>
    <tr>
        <th>弹出页面：</th>
        <td colspan="3">
            <select class="myselect" style="width:130px; max-height:200px;" onchange="form_types_change(this.value);" id="form_types">
                <option value=""></option>
                @Html.Raw(ViewData["formTypes"])
            </select>
            <select class="myselect" style="width:290px;" id="form_forms" onchange="loadFields(this.value);"></select>
        </td>
    </tr>
    <tr>
        <th>获取标题：</th>
        <td>
            关键字段：<select class="myselect" id="pkfield"></select>
            &nbsp;&nbsp;标题字段：<select class="myselect" id="titlefield"></select>
        </td>
    </tr>
    <tr>
        <th>参数名称：</th>
        <td>
            <input type="text" class="mytext" style="width:90%;" id="paramsname" />
        </td>
    </tr>
    <tr>
        <th>参数值：</th>
        <td>
            <textarea class="mytextarea" style="width:99%;height:60px;" id="paramsvalue"></textarea>
            <div><span style="color:#666;">这里写JS脚本，例 $("#RF_TEST-F1").val() 获取表单中某个控件值</span></div>
        </td>
    </tr>
    <tr>
        <th>父窗口：</th>
        <td><input type="text" id="opener" class="mytext" style="" /> <span style="color:#666;">打开弹窗的父窗口如:window,parent,top，默认window</span></td>
    </tr>
</table>
<script type="text/javascript">
    function initSelect2() {
        new RoadUI.Select().init2($("#bindfiled"));
    }
    function form_types_change(value) {
        if (!value) {
            return;
        }
        $.ajax({
            url: "../Applibrary/GetOptionsByAppType",
            type: "post",
            data: { "type": value, "value": "" },
            async: false,
            type: "post",
            success: function (txt) {
                $("#form_forms").html('<option value=""></option>' + txt);
            }
        })
    }
    function loadFields(value) {
        if (!value) {
            return;
        }
        $.ajax({
            url: "../ProgramDesigner/Set_ListField_Options", data: { applibaryid: value }, async: false, type: "post", success: function (txt) {
                $("#titlefield").html('<option value=""></option>' + txt);
                $("#pkfield").html('<option value=""></option>' + txt);
            }
        });
    }
</script>